package action;

import service.LoginService;
import bean.User;

import com.opensymphony.xwork2.ActionSupport;
//public class LoginAction extends ActionSupport
//这样可以return SUCCESS INPUT
public class LoginAction{

	private LoginService loginService;
	private User user;

	public String execute() throws Exception {
		System.out.println("user:" + user.getUserName());

		if (loginService.login(user)) {
			return "success";
		} else {
			return "input";
		}

	}

	public LoginService getLoginService() {
		return loginService;
	}

	public void setLoginService(LoginService loginService) {
		this.loginService = loginService;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}
